package com.kk.my_pro.common.exception;




import com.kk.my_pro.common.result.ApiResult;
import jakarta.servlet.http.HttpServletResponse;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class WebGlobalExceptionHandler {


//    @ExceptionHandler(value = Exception.class)
//    public ApiResult<String> exceptionHandler(HttpServletResponse response,Exception e){
//        System.out.println("服务器异常"+e);
//        response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
//        return ApiResult.failure(e.toString());
//    }

}
